UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '87GpVA6K+Phd5i3Y1MVqiKu0XbMs3Y48mgNUhaKK0Ck=' 
WHERE 
  key_id = '8030d30b32e366469b3256be1366c75cfb07b61f2f33842e2d2d9b5601f3f5b0' 
  AND (
    token = '87GpVA6K+Phd5i3Y1MVqiKu0XbMs3Y48mgNUhaKK0Ck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043