UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QVMAvBiWfKbRPIG8btyN0Co7VAHQRvItytArqe+mWxs=' 
WHERE 
  key_id = '091794d1414dd553f7e0b676b1244aa25080396ff4c38f067cedd2dd063c1a37' 
  AND (
    token = 'QVMAvBiWfKbRPIG8btyN0Co7VAHQRvItytArqe+mWxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033