UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nxdIbyY6hoBqTOSZvxayPSnksNtiO5lorvaJsFPZfLI=' 
WHERE 
  key_id = '4bc26dfaa53a21659e31dabbb4f33866931444dcff830498040de346e211d331' 
  AND (
    token = 'nxdIbyY6hoBqTOSZvxayPSnksNtiO5lorvaJsFPZfLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032