UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '220TndM5SbViiMw8dYyfOV8TGtyoCbtYLG/gOPHh47E=' 
WHERE 
  key_id = '678e7e7bbc0f04bc9796fc9a1b8adf8d720b304846b9f54508beaeb934d7f417' 
  AND (
    token = '220TndM5SbViiMw8dYyfOV8TGtyoCbtYLG/gOPHh47E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040