UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qCRf2KLRds2WKe/c4W+4Rbtf04WTu3GvmfZmN6eRSqw=' 
WHERE 
  key_id = '1b67db6ead9b151a6b96a92e928ce84a7a41997fefe4427a83d6f301e3adb254' 
  AND (
    token = 'qCRf2KLRds2WKe/c4W+4Rbtf04WTu3GvmfZmN6eRSqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049