UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oYy/SGt2ZnFYw34BtHQYmwYxER2tCWiudjZ3lGM2SQ4=' 
WHERE 
  key_id = '5ef8554ec772ef65fcf9e921f9908d1b20a0dd3e793ba616f31be6998cfd8a23' 
  AND (
    token = 'oYy/SGt2ZnFYw34BtHQYmwYxER2tCWiudjZ3lGM2SQ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042