UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M/NynP2/J3SkssYhktqfyIvbyFrWikhSVkeTtk4R/jc=' 
WHERE 
  key_id = '3ebfe0faf7f47aacf022e3ad5deffa641322343b609e70b7405d71a565b26554' 
  AND (
    token = 'M/NynP2/J3SkssYhktqfyIvbyFrWikhSVkeTtk4R/jc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042