UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'St8S/2HgITcmZ2BOIi65U8EZwA/O58ZOIieN/aoXQe0=' 
WHERE 
  key_id = '4e2fcd54f9d5ad1d2bccf7c6ac461099c11361f9016b58242af37537183eadec' 
  AND (
    token = 'St8S/2HgITcmZ2BOIi65U8EZwA/O58ZOIieN/aoXQe0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036