UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JEwBjH2BML9QdwCL/gDeNuiPY4G36aAa/ffwSJZ8BYA=' 
WHERE 
  key_id = '3575a4bec9d4d037e775b7e8a1f0b7392d231959fd87bf26dc0423fd94ac8ad3' 
  AND (
    token = 'JEwBjH2BML9QdwCL/gDeNuiPY4G36aAa/ffwSJZ8BYA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034