UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gWrt9+784Mbz+FVYC+Q7QuQy/ngEX5XBoHb1/hxtkZ0=' 
WHERE 
  key_id = 'ce2aa186c89f5ba3b473c5e1f0a93e5415c98e9e50dd548af488f14f02e3f2d8' 
  AND (
    token = 'gWrt9+784Mbz+FVYC+Q7QuQy/ngEX5XBoHb1/hxtkZ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035