UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QHQHj5NoFsXQxcRD1AR8xR1riHBAiAP/h6R69xro2Ds=' 
WHERE 
  key_id = '6e936b6afb41f6f20c4fcdf0df7889cd910e7af43aaf34131d1b9d6b927b4b50' 
  AND (
    token = 'QHQHj5NoFsXQxcRD1AR8xR1riHBAiAP/h6R69xro2Ds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020