UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0VB27z+pldz3FH4zd+P9K9R9eE7D60eDVmVNehPfS2U=' 
WHERE 
  key_id = '7f1fb06c9f0b1d6b743868cb04b703aa09a6315a33d1398e87196345caca492d' 
  AND (
    token = '0VB27z+pldz3FH4zd+P9K9R9eE7D60eDVmVNehPfS2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056