UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '231oVdwzbJVqeDOvSfXIwwjiyNad12t+OLf/DVZZNMM=' 
WHERE 
  key_id = '190c9d34ab59407c058a567cb2c9e12aecb9df5f19e88a77e84238541e5a19a2' 
  AND (
    token = '231oVdwzbJVqeDOvSfXIwwjiyNad12t+OLf/DVZZNMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034