UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/WN2DxEiJ3N6ebauX/2z1UL/kAnTY3BmrF6q8HsWTIg=' 
WHERE 
  key_id = '7efea83dd00addbb9c1475b410fb4a7cb27625438e40591112ce607a4dda506d' 
  AND (
    token = '/WN2DxEiJ3N6ebauX/2z1UL/kAnTY3BmrF6q8HsWTIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033