UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'urL1nXDDti4cOUKyQpkhmN0VIOIHiso69l7meEh5pK8=' 
WHERE 
  key_id = 'a5d5c584c6ba42cdb66c19d83247961bb97242c9ddf0a7d00d72202e2e85c0bf' 
  AND (
    token = 'urL1nXDDti4cOUKyQpkhmN0VIOIHiso69l7meEh5pK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059