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

Query time 0.00039