UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BOq2EXMJQ+b94PUmnFB5HEINv2gkgQxeOlPV2YGvBfo=' 
WHERE 
  key_id = 'fb20d4ff2f4b0499050997ab73d5d915d33f8f07aa7aa4583c4f24ef3a0210fd' 
  AND (
    token = 'BOq2EXMJQ+b94PUmnFB5HEINv2gkgQxeOlPV2YGvBfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039