UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I/jcHHZ60liHc5Dot4GLxi4pXIsP1i3UN4xT9pjlMz8=' 
WHERE 
  key_id = '20a35bf75bc3e5207e5af72a28c5c5a69465455286d5cd74d0200176d5f7d60f' 
  AND (
    token = 'I/jcHHZ60liHc5Dot4GLxi4pXIsP1i3UN4xT9pjlMz8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048