UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HoJCJDrV68C3eUH8fYvE7WOFgNvb3VCc9ThxpE3tvzs=' 
WHERE 
  key_id = '6b52aad421cee0b3e3eb16a154a19f41d4dfdb84da463e14afe9c335332655f6' 
  AND (
    token = 'HoJCJDrV68C3eUH8fYvE7WOFgNvb3VCc9ThxpE3tvzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033