UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hJjWOZ4McTMBBOR4Da1yQ0Q25NHS6kqKN+NozT799GY=' 
WHERE 
  key_id = '755e082c6583f01f40fd15e8d927072afea94d9570ff837b00c61793e7c9b070' 
  AND (
    token = 'hJjWOZ4McTMBBOR4Da1yQ0Q25NHS6kqKN+NozT799GY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027