UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Gg9Drn3dZw9nCc3t/HUPhV4TW/1blipsoeCcvoVJzQ=' 
WHERE 
  key_id = '414e4a6d4872ee249873bae75c77ae416ae58f2094a4f07bf892e83eedc35e34' 
  AND (
    token = '2Gg9Drn3dZw9nCc3t/HUPhV4TW/1blipsoeCcvoVJzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034