UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pUa6q8a5UUgYQ/2bGy8lk4CjqdR1vh3ClGT7NKb6WqU=' 
WHERE 
  key_id = 'a9b38fe1aaa8112aac216e68b05c7e20bf416dc58905342b3784d20357321ba6' 
  AND (
    token = 'pUa6q8a5UUgYQ/2bGy8lk4CjqdR1vh3ClGT7NKb6WqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019