UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't2L/gvEwW7oEFPehURzdk5hz7P7nj3s3HnrtbjXmd7Q=' 
WHERE 
  key_id = '79eb02789560166617cc8308a037b9e820024100ecca8c8148cbb1ab9c01fe8e' 
  AND (
    token = 't2L/gvEwW7oEFPehURzdk5hz7P7nj3s3HnrtbjXmd7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032