UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Op1WkIscMPCLWVDeIPwP/0/D82hIgTA1Aary1xijRcw=' 
WHERE 
  key_id = '564448869f242493ba3405eaca5772eaf1606aad643587db936fa96a9c7e31ba' 
  AND (
    token = 'Op1WkIscMPCLWVDeIPwP/0/D82hIgTA1Aary1xijRcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025